<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.gm.baseplatform.base.module.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>base-platform首页</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/js/easyui/themes/default/easyui.css"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/js/easyui/themes/icon.css"/>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/easyui/locale/easyui-lang-zh_CN.js"></script>
     <script type="text/javascript">
     function addTab(title, href) {
            var tt = $('#main-center');
            if (tt.tabs('exists', title)) {
                tt.tabs('select', title);
            } else {
                if (href) {
                    var content = '<iframe scrolling="yes" frameborder="0"  src="' + href + '" style="width:99%;height:99%;padding:2px"></iframe>';
                } else {
                    var content = '未实现';
                }
                tt.tabs('add', {
                    title: title,
                    closable: true,
                    content: content
                });
            }
        }
     </script>
  </head>
 <%
     Map<Module,List<?>> moduleTree = (Map<Module,List<?>>)request.getAttribute("moduleTree");
 %>
 <body class="easyui-layout">
	<div region="north" border="false" style="height:100px;background:#B3DFDA;padding:10px">north region</div>
	<div region="west" split="true" title="导航菜单" style="width:200px;">
	  <div id="aa" class="easyui-accordion" border="false" fit="true" style="height: auto;">
	    <%
	       Iterator<Module> it = moduleTree.keySet().iterator();
	       while (it.hasNext()) {
	         Module parent = it.next();
	         List<?> childs = moduleTree.get(parent);
	         if (childs == null) continue;
	       
	    %>
		<div title="<%=parent.getName()%>" iconCls="icon-ok" style="overflow:auto;">
		    <%
		       for (int i = 0; i < childs.size(); i++) {
		         Module child = (Module)childs.get(i);
		         if (child == null) continue;
		    %>
			<h3 style="color:#0099FF;"><a href="javascript:addTab('<%=child.getName()%>','<%=request.getContextPath()%>/<%=child.getPerformAction()%>')"><%=child.getName()%></a></h3>
			<%
			   }
			%>
		</div>
		<%
		   }
		%>
	  </div>
	</div>
	<div region="south" border="false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
	<div region="center" >
	<div id="main-center" class="easyui-tabs" fit="true" border="false">
            <div title="首页" style="padding: 20px;">
                <div style="margin-top: 20px;">
                    <p>xxxx有限公司。</p>
                    <p>&nbsp;</p>
                    <p>监控平台。</p>
                    <p>&nbsp;</p>
                </div>
            </div>
        </div>
	</div>
</body>
  
</html>
